package andanyoung.seata.order.service;

import andanyoung.seata.order.entity.Order;
import andanyoung.seata.order.repository.OrderRepository;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * @author andyoung
 */
@Service
public class OrderService {
    @Resource
    private OrderRepository orderRepository;

    @Transactional
    public Order createOrder(Integer orderId, Integer memberId, Integer goodsId, Integer points, Integer quantity){
        return orderRepository.save(new Order(orderId, memberId,goodsId,points,quantity));
    }
}
